﻿#ifndef __SS_TRIE_NODE_H__
#define __SS_TRIE_NODE_H__
#include "../ssMap.h"

namespace StarSeeker
{
	template<typename N_KEY, typename N_VALUE>
	class ssTrieNode
	{
		template<typename D_KEY, typename D_VALUE> friend class ssTrieTree;
	public:
		ssTrieNode()
		{
			m_pParent = 0;
			m_pValue = 0;
			m_pOnwer = 0;
		};
		N_VALUE* Data()
		{
			return m_pValue;
		}
		const N_KEY& Key()
		{
			return m_key;
		}
		void SetData(N_VALUE* val)
		{
			if (m_pValue)
			{
				delete m_pValue;
			}
			m_pValue = val;
		}
	private:
		ssTrieNode*		m_pParent;
		N_KEY			m_key;
		N_VALUE*		m_pValue;
		void*			m_pOnwer;
		ssMap<N_KEY, ssTrieNode*> m_children;
	};

}
#endif
